package com.model.model02.demo02.discount;

import com.model.model02.demo02.discount.abs.CashSuper;

public class CashReturn extends CashSuper {

    private double moneyCondition = 0;
    private double moneyReturn = 0;

    public CashReturn(double moneyCondition, double moneyReturn) {
        this.moneyCondition = moneyCondition;
        this.moneyReturn = moneyReturn;
    }

    @Override
    public double acceptCash(double money) {
        double result = money;
        if (money >= moneyCondition) {
            result = money - moneyReturn;
        }
        return result;
    }
}
